package cn.gok.qqclient.services.impl;




import cn.gok.qqclient.beans.Page;
import cn.gok.qqclient.beans.Province;
import cn.gok.qqclient.daos.ProvinceDao;
import cn.gok.qqclient.services.ProvinceService;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProvinceServiceImpl implements ProvinceService {


    @Autowired
    private ProvinceDao provinceDao;

    @Override
    public List<Province> getAllData() {
        return   provinceDao.getAllData();
    }

    @Override
    public PageInfo<Province> getDataBypage(Page page) {
        PageHelper.startPage(page.getCurrentPage(),page.getPageSize());
        List<Province> allData = provinceDao.getAllData();
        PageInfo pageInfo=new PageInfo(allData);
        return pageInfo;
    }


}
